package com.qf.mp2302.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;

/**
 * CREATE TABLE sys_suer_bak AS SELECT * FROM sys_user;
 * INSERT INTO sys_user(NAME,age,email,sex) SELECT NAME,age,email,sex FROM sys_suer_bak;
 */
// ### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.user' doesn't exist
@Data
@TableName("sys_user")
public class User implements Serializable {

    /**
     * 注意，如果数据库表的主键id设置为了自增，
     * 不要使用update语句去修改数据库的id ，如果修改id，会导致自增id值出现冲突
     * ### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1688791947478740997' for key 'PRIMARY'
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private Integer age;
    @TableField("t_email")
    private String email;

    @TableLogic
    private Integer deleted;
}
